%\gray
%\chapter[Category]{Category Theory}
\section{Notation}
\begin{terminology}
Let $\bcC$ be a category, $f\in A(\bcC)$ that factors as $f=h\circ g$. Then, if $g$ is determined uniquely for $h$, we write $h\backslash f=g$. Also, if $h$ is determined uniquely for $g$, we write $f\slash g=h$.\\
\end{terminology}
\begin{terminology}
Let $\bcC$ be a category with pullbacks, $\xymatrix{X\ar@<+2pt>[rr]^{h}\ar@<-2pt>[rr]_{l}&&W\ar[r]|{g}&V\ar[rr]|f&&U}$ in $\bcC$. We define $h\times_{f,g} l$ to be the unique morphism that makes the following diagram commutative
\begin{equation}\label{h_fg_l}
\xymatrix{&X\ar[rr]^h&&W\ar[r]^{g}&V\ar[dr]^f&\\
X\times_V X \ar@{-->}[rr]|{h\times_{f,g} h} \ar[ur]^{\pi_{X,1}}\ar[dr]_{\pi_{X,2}} &&  W\times_U W \ar[ur]^{\pi_{V,1}}\ar[dr]_{\pi_{V,2}}&&&U\\
&X\ar[rr]_l&&W\ar[r]_{g}&V\ar[ur]_f&
}
\end{equation}
Where $(\pi_{V,1},\pi_{V,2})$ is the kernel pair of $f\circ g$, $(\pi_{X,1},\pi_{X,2})$ is the pullback projection of the diagram $\xymatrix{X\ar@<+2pt>[rr]^{g\circ h}\ar@<-2pt>[rr]_{g\circ l}&&U}$\\
For $g=id_V$, we may abuse the notation and write $h\times_f l$, and for $f=id_U$, we may write $h\times_{U,g} l$.
\end{terminology}
\tcb{define the category on which $g\times_f h$ is nothing but a categorical product.}
\begin{terminology}\label{PtimesfP}
Let $\bcC$ be a category with pullbcaks, $U_k\stackrel{f_k}{\rightarrow}U\stackrel{f_{k'}}{\leftarrow}U_{k'}$, $f:V\rightarrow U$ in $\bcC$. Then, we define $p_{1,U_k,V}\times_f p_{1,U_{k'},V}$ to be the unique morphism that makes the following diagram commute:
$$
{\small\xymatrix{
&&\tiny{U_k\times_U V}\ar@{..>}[rd]|{p_2}\ar[rrrrrr]|{p_1}&&&&&& U_k\ar[dr]^{f_k} &\\
&&&V\ar@{..>}[rrrrrr]|f&&&&&&U\\
W\ar@{-->}[rrrrrr]|{\tiny{p_{1,U_k,V}\times_f p_{1,U_{k'},V}}}\ar[rruu]|{p_1}\ar[dr]|{p_2}&&&&&&\tiny{U_k\times_U U_{k'}}\ar[rruu]|{ p_1}\ar[dr]|{p_2}\\
&\tiny{U_{k'}\times_U V}\ar@{..>}[uurr]\ar[rrrrrr]|{p_1}&&&&&&U_{k'}\ar[uurr]_{f_{k'}}
}}
$$
Where, $W=(U_k\times_U V)\times_V (U_{k'}\times_U V)$. Notice that names of pullback projections have been shorten, some omitted, to make the diagram more readable.\\
The existence and uniqueness of $p_{1,U_k,V}\times_f p_{1,U_{k'},V}$ is due to the universal property of $U_k\times_U U_{k'}$ and the fact that $f_k\circ p_{1,U_k,V}\circ  p_{1,U_k\times_U V,U_{k'}\times_U V}=f_{k'}\circ p_{1,U_{k'},V}\circ  p_{2,U_k\times_U V,U_{k'}\times_U V}$.
\end{terminology}
\tcg{find a genaralised notation includes all cases!!}
\begin{definition}[Product morphisms]
Let $\bcC$ be a category, $\epsilon:J\rightarrow I$ a map of sets, $f_j:A_{\epsilon(j)}\rightarrow B_j$ in $\bcC$, $\forall j\in J$, and $\displaystyle\prod_{k\in I}A_k$ and $\displaystyle\prod_{l\in J}B_l$ exist in $\bcC$, then, we define $\displaystyle\prod_{l\in J}f_l$ to be the unique morphism that makes the following diagram commutative, $\forall j\in J$:
$$
\xymatrix{
\displaystyle\prod_{k\in I}A_k\ar@{-->}[rr]^{\displaystyle\prod_{l\in J}f_l}\ar[d]_{\pi_{\epsilon(j)}}  && \displaystyle\prod_{l\in J}B_l\ar[d]^{\pi_j}\\
A_i\ar[rr]_{f_j} &&B_j
}
$$
\end{definition}
\begin{remark}
Notice that the previous depends on the universal property of $\displaystyle\prod_{l\in J}B_l$, hence we needed to construct morphism from $\displaystyle\prod_{k\in I}A_k$ to each of $B_j,j\in J$. Which explain the need to use the map $\epsilon$.
\end{remark}
\begin{lemma}
Let $\bcC$ be a category, $\epsilon:J\rightarrow I$ a map of sets $f_j:A_{\epsilon(j)}\rightarrow B_j$ in $\bcC$, $\forall j\in J$. Where, $\displaystyle\prod_{k\in I}A_k$ and $\displaystyle\prod_{l\in J}B_l$ exist. Then:
\begin{itemize}
\item If $f_j$ is a monomorphis $\forall j\in J$, and $\epsilon$ is a surjective. Then, $\displaystyle\prod_{l\in J}f_l$ is a monomorphism.
\item If $f_j$ is a monomorphis $\forall j\in J$, and $\epsilon$ is not a surjective. Then, $\displaystyle\prod_{l\in J}f_l$ is a not necessary a monomorphism.
\item If $f_j$ is a epimorphis, $\forall j\in J$. Then, $\displaystyle\prod_{l\in J}f_l$ is a not necessary an epimorphism.
\end{itemize}
\end{lemma}
\begin{proof}:
\begin{itemize}
\item
Let $f_j$ be a monomorphis, $\forall j\in J$, $\epsilon$ is a surjective, and let $g,h:Z\rightarrow \displaystyle\prod_{k\in I}A_k$ such that ${\displaystyle\prod_{l\in J}f_l}\circ g={\displaystyle\prod_{l\in J}f_l}\circ h$.
Then, $f_j\circ \pi_{\epsilon(j)}\circ g=\pi_j\circ\displaystyle\prod_{l\in J}f_l\circ g=\pi_j\circ\displaystyle\prod_{l\in J}f_l\circ h=f_j\circ \pi_{\epsilon(j)}\circ h$ $\forall j\in J$.
$f_j$ is a monomorhism $\forall j\in J$. Then, $\pi_{\epsilon(j)}circ g=\pi_{\epsilon(j)}\circ h, \forall j\in J$. Since, $\epsilon$ is a surjective, then $\forall i\in I, \exists j_i\in J:i=\epsilon(j_i)$. Hence, $\pi_i \circ g=\pi_i\circ h, \forall i\in I$. Then, by the universal property of $\displaystyle\prod_{k\in I}A_k$, we find that $g=h$. Therefore, $\displaystyle\prod_{l\in J}f_l$ is a monomorphism.
\item \tcb{type example of both cases when it is mono, and when is not}
\item \tcb{type example of both cases when it is epi, and when is not}
\end{itemize}
\end{proof}
\begin{lemma}
Let $\bcC$ be a category, the following diagram commutes in $\Sets$
$$
\xymatrix{I&J\ar[l]_{\epsilon}\\
J'\ar[u]^{\epsilon'}&K\ar[l]^{\eta'}\ar[u]_{\eta}
}
$$
$f_j:A_{\epsilon(j)}\rightarrow B_j$, $f'_{j'}:A_{\epsilon'(j')}\rightarrow B'_{j'}$, 
$g_j:B_{\eta(l)}\rightarrow C_l$, $g'_{l}:B_{\eta'(l)}\rightarrow C_l$ in $\bcC$, $\forall j\in J,j'\in J', l\in L$.
and $\displaystyle\prod_{i\in I}A_i,\displaystyle\prod_{j\in J}B_j,\displaystyle\prod_{j'\in J'}B_{j'},$ and $\displaystyle\prod_{k\in K}C_k$ exists in $\bcC$. Then, the commutativity of the diagram
$$\xymatrix{
\displaystyle\prod_{i\in I}A_i\ar[rr]^{\displaystyle\prod_{j\in J}f_j}\ar[dd]_{\displaystyle\prod_{j'\in J'}f'_{j'}}&&\displaystyle\prod_{j\in J}B_j\ar[dd]^{\displaystyle\prod_{k\in K}g_k}\\\\
\displaystyle\prod_{j'\in J'}B'_{j'}\ar[rr]_{\displaystyle\prod_{k\in K}g'_k}&& \displaystyle\prod_{k\in K}C_k}
$$
is equivlent to the commutativity of the following diagrams, $\forall k\in K$
$$
\xymatrix{
A_{\epsilon(\eta(k))}\ar[r]^{f_{\eta(k)}}\ar[d]_{f'_{\eta'(k)}}&B_{\eta(k)}\ar[d]^{g_k}\\
B'_{\eta'(k)}\ar[r]_{g'_k}&C_k}
$$
\end{lemma}
\begin{proof}
Type it
\end{proof}

\tcb{what if the diagram does not commute}
\begin{definition}[Section]\label{Section}
Let $\bcC$ be a category, $p:X'\rightarrow X$ in $\bcC$, we say $s:X\rightarrow X' $ is a section of $p$ if $p\circ s=id_X$.
\end{definition}
\noindent Notice that a morphism $f$ might have more than one section, look for the case arisen from sections of vector bundles of varieties.
\section{Preliminaries}
\tcb{equivelence of definition of monomorphism, direct limit}
\begin{definition}
Let $\bcC$ be a category, $f:V\rightarrow U$ in $\bcC$, $\bcU=\{f_i:U_i\rightarrow U|i\in I\}$ be a family of morphisms of $\bcC$:
\begin{itemize}
\item We say that $f$ is an epimorphism if $f^{\ast}:Hom_{\bcC}(U,W)\rightarrow Hom_{\bcC}(V,W)$ is an \underline{injective}, $\forall W\in \bcC$.
\item We say that $f$ is an monomorphism if $f_{\ast}:Hom_{\bcC}(W,V)\rightarrow Hom_{\bcC}(W,U)$ is an \underline{injective}, $\forall W\in \bcC$.
\item We say that the sequence $\xymatrix{V\ar[r]|f&U\ar@<+2pt>[r]^{g}\ar@<-2pt>[r]_{g'}&T}$ is exact iff $f$ is the equalizer of $\xymatrix{U\ar@<+2pt>[r]^{g}\ar@<-2pt>[r]_{g'}&T}$.
\item \tcb{Note that: $f_{i}\times_U f_{j}=f_{j}\times_U f_{i}$}.\\
\item We say that $\bcU$ is a family of epimorphisms  if the following diagrams are exact, $\forall W\in \bcC$:
$$Hom_{\bcC}(U,W)\stackrel{\displaystyle\prod_{i\in I}f_i^{\ast}}{\longrightarrow} \displaystyle\prod_{i\in I}Hom_{\bcC}(U_i,W)$$
\tcb{proof the equivalence of having a family of epimorphisms, and having each of them an epimorphism! Same for the other two definition. Otherwise give counter examples.}
\item We say that $\pi_1,\pi_2$ is the kernel pair of $f$ if $V\times_U V$ exists, and we have the pullback diagram:
$$
\xymatrix{V\times_U V\ar[r]^{\pi_1}\ar[d]_{\pi_1}&V\ar[d]^f\\
V\ar[r]_f&U}
$$
\end{itemize}
\end{definition}
\begin{conjecture}
\tcb{Each kernel pair is a pair of epimorphisms.}
\end{conjecture}
\begin{proof}[\tcr{Proof/Disproof}]
\tcb{Either prove or give a counter example.}
\end{proof}

\begin{definition}[Effective epimorphism]\label{Effective epimorphism}
Let $\bcC$ be a category with all pullbacks, $f:V\rightarrow U$ in $\bcC$, we say that $f$ is an effective epimorphism if the follwoing diagrams are exact, $\forall W\in \bcC$:
$$
\xymatrix{ Hom_{\bcC}(U,W)\stackrel{f^{\ast}}{\longrightarrow} Hom_{\bcC}(V,W)\ar@<-3pt>[rr]_!{"1,1";"1,2"}{\pi^{\ast}_2}\ar@<3pt>[rr]^!{"1,1";"1,2"}{\pi^{\ast}_1}& &Hom_{\bcC}(V\times_U V,W)}
$$
Where $(\pi_1,\pi_2)$ is the kernel pair of $f$.
Let $\bcU=\{f_i:U_i\rightarrow U|i\in I\}$ be a family of morphisms of $\bcC$, we say that $\bcU$ is a family of effective epimorphisms if the following diagrams are exact, $\forall W\in \bcC$:
\begin{equation}\label{FUEEDiagram}
\xymatrix{ Hom_{\bcC}(U,W)\stackrel{\displaystyle\prod_{i\in I}f_i^{\ast}}{\longrightarrow} \displaystyle\prod_{i\in I}Hom_{\bcC}(U_i,W)\ar@<-3pt>[rr]_!{"1,1";"1,2"}{\displaystyle\prod_{i,j\in I}\pi_{2,i,j}^{\ast}}\ar@<3pt>[rr]^!{"1,1";"1,2"}{\displaystyle\prod_{i,j\in I}\pi_{1,i,j}^{\ast}}& &\displaystyle\prod_{i,j\in I}Hom_{\bcC}(V\times_U V,W)}
\end{equation}
\end{definition}
For $f$, since the diagram is exact then $Hom_{\bcC}(U,W)\stackrel{f^{\ast}}{\rightarrow} Hom_{\bcC}(V,W)$ is an injection, i.e. $f$ is an epimorphism. Same argument implies that $\bcU$ is a family of epimorphisms. Same argument applies for the family $\bcU$.
\begin{definition}[Universal Effective epimorphism]\label{Universal Effective epimorphism}
Let $\bcC$ be a category with all pullbacks, $\bcU=\{f_i:U_i\rightarrow U|i\in I\}$ be a family of morphisms of $\bcC$, we say that $\bcU$ is a family of universal effective epimorphisms if $\bcU_f:=\{\pi_V:U_i\times_U V\rightarrow V|i\in I\}$ is a family of effective epimorhpisms for each $f:V\rightarrow U$.
\end{definition}
\begin{lemma}
Let $\bcC$ be a category with all pullbacks, $\bcU=\{f_i:U_i\rightarrow U|i\in I\}$ a family of universal effective epimorphisms, then $\bcU$ is a family of effective morphisms.
\end{lemma}
\begin{proof}
Put $U=V$ and $f=id_U$, then we have the pullback diagram
$$
\xymatrix{U_i\ar@{-->}[r]^{f_i}\ar@{-->}[d]_{id_{U_i}}&U\ar[d]^{id_U}\\
U_i\ar[r]_{f_i}&U}
$$
Hence, $\bcU$ is a family of effective morphisms.
\end{proof}
\begin{example} [Examples of FUEE] Let $\bcC$ be a category, $f:V\rightarrow U$ in $\bcC$\\
\begin{itemize}
\item $\bcU=\{id_U\}$ is FEE, that the diagram \ref{FUEEDiagram} becomes:
$$
\xymatrix{Hom_{\bcC}(U,W)\stackrel{id_{Hom_{\bcC}(U,W)}}{\longrightarrow} Hom_{\bcC}(U,W)\ar@<-3pt>[rr]_!{"1,1";"1,2"}{id_{Hom_{\bcC}(U,W)}}\ar@<3pt>[rr]^!{"1,1";"1,2"}{id_{Hom_{\bcC}(U,W)}}& &Hom_{\bcC}(U,W)}
$$
Which is evidently exact!
\item \tcb{type more natural and reasonable examples}
\end{itemize}
\end{example}
\begin{fact}\label{fgEpi}
Let $\bcC$ be a category with pullbacks, $\xymatrix{W\ar[r]^{g}&V\ar[r]^f&U}$ in $\bcC$, two epimorphisms. Then, $g\times g $ is not necessary an epimophism.
\end{fact}
\begin{proof}
In the settings of \ref{h_fg_l}, for the given diagram we have the commutative diagram:
$$
\xymatrix{&W\ar[rr]^g&&V\ar[dr]^f&\\
W\times_V W \ar@{-->}[rr]|{g\times_f g} \ar[ur]^{\pi_{W,1}}\ar[dr]_{\pi_{W,2}} &&  V\times_U V \ar[ur]^{\pi_{W,1}}\ar[dr]_{\pi_{W,2}}&&U\\
&W\ar[rr]_g&&V\ar[ur]_f&
}
$$
Then we have $\pi_{V,2}\circ (g\times_f g)=g\circ\pi_{W,2}=g\circ\pi_{W,2}=\pi_{V,2}\circ (g\times_f g)$, where $\pi_{V,1}$ does not necessary equal $\pi_{V,2}$.
\end{proof}
\begin{example}
Let $\bcC=\Sets, U=\{e\}, V=\{\alpha,\beta\}, W=\{a,b,c\}, f$ is the unique map $f:V\rightarrow U$, and $g:W\rightarrow V$ defined by $g(a)=g(b)=\alpha,g(c)=\beta$. Then we have, $V\times_U V=V\times V$, and $W\times_V W=\{(a,a),(a,b),(b,a),(b,b),(c,c)\}$, with the canonical projection. Hence, $g\times_f g$ is defined by $(g\times_f g)((x,y))=(\beta,\beta)$ for $(x,y)=(c,c)$, and $(g\times_f g)((x,y))=(\alpha,\alpha)$ otherwise.
Witch is not epimorphism in $\Sets$
\end{example}
\begin{lemma}\label{UEEComposition}
Let $\bcC$ a category with pullbacks, then the composition of epimorphisms/EE/UEE is epimorphisms/EE/UEE.
\end{lemma}
\begin{proof}[\tcr{Wrong proof!}]
Let $\bcC$ be a category with pullbacks, and $W\stackrel{g}{\rightarrow}V\stackrel{f}{\rightarrow} U$ in $\bcC$, then:
\begin{itemize}
\item If $f$ and $g$ are epimorphisms, then, $\forall Z \in \bcC$, $Hom_{\bcC}(U,Z)\stackrel{f^{\ast}}{\rightarrow} Hom_{\bcC}(V,Z)\stackrel{f^{\ast}}{\rightarrow} Hom_{\bcC}(W,Z)$ is a sequence of injective maps, hence $Hom_{\bcC}(U,Z)\stackrel{(f\circ g)^{\ast}}{\rightarrow} Hom_{\bcC}(W,Z)$ is an injective map, that $(f\circ g)^{\ast}=g^{\ast}\circ f^{\ast}$. Therefore, $f\circ g$ is an epimorphism.
\item If $f$ and $g$ are EE, then, $\forall Z \in \bcC$, we have the commutative diagram:
\begin{equation}\label{EE}
{\small \xymatrix{ X\ar@/^/[drrr]^h\ar@{-->}@/_/[ddr]_{h'}\ar@{..>}[dr]|{h''}&&&&&\\
&Hom_{\bcC}(U,Z)\ar[rr]^{(f\circ g)^{\ast}}\ar[d]_{f^{\ast}}&&
Hom_{\bcC}(W,Z)\ar@{=}[d]\ar@<+2pt>[rr]^{\pi\prime_{W,1}^{\ast}}\ar@<-2pt>[rr]_{\pi\prime_{W,2}^{\ast}}&&Hom_{\bcC}(W\times_U W,Z)\ar[d]^{(id_W\times_{f,g} id_W)^{\ast}}\\
&Hom_{\bcC}(V,Z)\ar[rr]^{g^{\ast}}\ar@<+2pt>[d]^{\pi_{V,2}^{\ast}}\ar@<-2pt>[d]_{\pi_{V,1}^{\ast}}&&
Hom_{\bcC}(W,Z)\ar@<+2pt>[rr]^{\pi_{W,1}^{\ast}}\ar@<-2pt>[rr]_{\pi_{W,2}^{\ast}}\ar@<+2pt>[d]^{\pi_{W,2}^{\ast}}\ar@<-2pt>[d]_{\pi_{W,1}^{\ast}}&&Hom_{\bcC}(W\times_V W,Z)\ar@{=}[dll]\\
&Hom_{\bcC}(V\times_U V,Z)\ar[rr]_{(g\times_f g)^{\ast}}&&Hom_{\bcC}(W\times_V W,Z)&&
}}
\end{equation}
The first row is exact that:
	\begin{itemize}
	\item [*] $\pi\prime_{W,1}^{\ast}\circ(f\circ g)^{\ast} =\pi\prime_{W,2}^{\ast}\circ(f\circ g)^{\ast}$. That, $(f\circ g)\circ \pi\prime_{W,1}=(f\circ g)\circ \pi\prime_{W,2}$, and $-^{\ast}=Hom_{\bcC}(-,Z)$ is a covariant functor.
	\item [*] Let $h:A\rightarrow Hom_{\bcC}(W,Z)$ such that $\pi\prime_{W,1}^{\ast}\circ h =\pi\prime_{W,2}^{\ast}\circ h$, we have:\\
	$(id_W\times_{f,g} id_W)^{\ast}\circ \pi\prime_{W,1}^{\ast}\circ h =(id_W\times_{f,g} id_W)^{\ast}\circ \pi\prime_{W,2}^{\ast}\circ h\Rightarrow$
	$\pi_{W,1}^{\ast}\circ h =\pi_{W,2}^{\ast}\circ h$. The exactness of the second row implies $\exists! h':A\rightarrow Hom_{\bcC}(V,Z)$ such that $h=g^{\ast}\circ h'$.\\
	Then we have $(g\times_f g)^{\ast}\circ \pi_{V,1}^{\ast}\circ h'=\pi_{W,1}^{\ast}\circ g^{\ast}\circ h'=\pi_{W,2}^{\ast}\circ g^{\ast}\circ h'=(g\times_f g)^{\ast}\circ \pi_{V,2}^{\ast}\circ h'$ (The second equation due to the exactness of the second row and the fact that the second pair of arrows of the second row are the same as of those of the second column). \tcr{$(g\times_f g)^{\ast}$ is not an injection, that $g\times_f g$ is not an epimorphism \ref{fgEpi}} , \tcb{then??} $\pi_{V,1}^{\ast}\circ h'= \pi_{V,2}^{\ast}\circ h'$. Hence, $\exists! h'':A\rightarrow Hom_{\bcC}(U,Z)$ such that $h'=f^{\ast}\circ h''$, due to the exactness of the first column.\\
$h=g^{\ast}\circ h'=^{\ast}\circ f^{\ast}\circ h''=(f\circ g)^{\ast}\circ h''$.\\
All what is left to prove the exactness of the first row is to show the uniqueness of $h''$ for given $h$.\\
Let $l:A\rightarrow Hom_{\bcC}(U,Z)$ such that $h=(f\circ g)^{\ast}\circ l\rightarrow g^{\ast} \circ h'=g^{\ast} \circ f^{\ast} \circ l$. $g^{\ast}$ is an injection, for being an equaliser morphism. Hence, $h'=f^{\ast} \circ l$, but $f^{\ast} \circ h''$, and $f^{\ast}$ is an injection, for the same reason. Therefore, $l=h''$ and the first row is exact. Then, $f\circ g$ is an EE.
	\end{itemize}
\tcb{Show that the construction of the commutative diagram was natural!!}
\tcb{Here, we could not use the $3\times 3$ diagrams that the middle column is not necessary exact!}	
\item If $f$ and $g$ are UEE, then for $f:V'\rightarrow U$, $\forall Z \in \bcC$, let $p_{V'},p_W$ be the projections of the pullback diagram:

$$
\xymatrix{W\ar[r]^g&V\ar[r]^f&U\\
W\times_U V'\ar@{-->}[u]^{p_W}\ar@{-->}[rr]_{p_{V'}}&&V'\ar[u]_{f'}
}
$$
Then, $\forall Z \in \bcC$, we have the commutative diagram:
\begin{equation}\label{UEE}
\text{The correct diagram}
\end{equation}
\tcb{We'll end up with the same sort of issue. Either change the diagram, or disprove the lemma! Consider examples}

\end{itemize}
\end{proof}
\tcb{Generalise to the case of family of morphisms.}\label{FUEEComposition}

\begin{definition} [Subfunctor]
Let $\bcF:\bcC\rightarrow\bcD$ be a functor, we say that $\bcG:\bcC\rightarrow\bcD$ is a subfunctor of $\bcF$ if there exists a monic natural transformation $i:\bcG\stackrel{\cdot}{\rightarrow}\bcF$. It is called subfunctor for being a subobject in the category $\bcD^{\bcC}$.
\end{definition}
\section{(Co)Limits}
\begin{lemma}
Let $\bcC$ be a category with limits, then $(W\times_U V)\times_V(W'\times_U V)\cong W\times_U V \times_U W'$, for every diagram:
$$
\xymatrix{W\ar[rd]_h&V\ar[d]|f&W'\ar[ld]^{h'}\\
&U&}
$$
\end{lemma}
\begin{proof}
\tcb{Write it down}
\end{proof}
\tcb{explain the ambiguity of the notation}
\begin{lemma}\label{Pullback}
Let $\bcC$ be a category with pullbacks, let $W\stackrel{f}{\rightarrow}V\stackrel{f}{\rightarrow}X\stackrel{f}{\leftarrow}U$ be a diagram in $\bcC$. Then, $W\times_X U\cong W_V(W\times_X U)$
\end{lemma}
\begin{proof}
!!!!!!
\end{proof}
\begin{lemma}
The pull-back of a monomorphism is a monomorphism.
\end{lemma}
\begin{proof}
Let $\bcC$ be a category with pull-backs, $f:Y\hookrightarrow X, g:Z\rightarrow X$ in $\bcC$, $f$ a monomorphism. Consider, the below Cartesian diagram, and let $f_1,f_2:W\rightrightarrows Y\times_X Z$ in $\bcC$ such that $p_1\circ f_1=p_1\circ f_2$:
\[
\xymatrix{
&Y\ar@{^(->}[r]^f&X\\
&Y\times_X Z\ar[r]_{p_1}\ar[u]^{p_2}&Z\ar[u]_g\\
W\ar@<+2pt>[ru]^{f_1}\ar@<-2pt>[ru]_{f_2}&&
}
\]
then, the commutativity of the diagram and having $f$ a monomorphism implies that $p_1\circ f_1=p_1\circ f_2$. Since, the big diagram commutes of either of $f_1$ or $f_2$, then by the universal property of pull-backs, we find that $f_1=f_2$, which implies that $p_1$ is monomorphism.
\end{proof}
\begin{corollary}
The push-forward of an epimorphism is an epimorphism.
\end{corollary}

F\section{Abelian Categories}
\tcg{Write down the equivalence theorem}\\
\tcg{Source of definition of abelian category}
\begin{definition}[Additive Categories]
A (small) category $\bcC$ is called additive category iff:
\begin{itemize}
\item $Hom_{\bcC}(A,B)$ is an abelian group $\forall A,B\in ob (\bcC)$.
\item $\forall A,B\in \bcC, A\prod B$ and $A\coprod B$ exist in $\bcC$.
\item $\bcC$ has a null object, both initial and terminal, denoted by $0$.
\end{itemize}
We denote the unique morphism $A\rightarrow B=0\rightarrow B \circ A\rightarrow 0$ by $\underline{0}$.
\end{definition}
\begin{definition}[Pre-Abelian Categories]
An additive category $\bcC$ is called Pre-Abelain category iff $\ker f$ and $\coker f$ exist $\forall f \in A(\bcC)$.
\end{definition}
\begin{lemma}
A category $\bcC$ is a pre-abelian category iff it is a additive category that is limit and colimit complete (i.e. has all limits and colimits).
\end{lemma}
\begin{proof}
\tcb{type it down}
\end{proof}
\begin{lemma}
Let $\bcC$ be a pre-abelian category, then $\forall f\in A(\bcC)$, then $f$ factors through a canonical morphism $\hat{f}:\Coim f \rightarrow \Imm f$, such that $f=\im f \circ \hat{f} \circ \coim f$.
\end{lemma}
\begin{proof}
Let fdf\\
$\xymatrix{&A''\ar@{-->}[r]&\Coim f\ar@{-->}[rrrdd]\ar@{..>}[rrr]&&&\Imm f\ar[dd]&B''\ar[ddl]\ar@{-->}[l]&&\\
&&&&&&&&\\
\Ker f\ar[rr]^{\ker f}&& A\ar[uu]\ar[uul]\ar[rrr]|f\ar@{-->}[uurrr]&&&B\ar[rr]^{\coker f}\ar[rrd]_{h}&&\Coker f\ar@{-->}[d]^{ h \slash \coker f }\\
A'\ar[rru]_{g}\ar@{-->}[u]^{\ker f \backslash g}&& &&& &&B'}$
\end{proof}
\begin{definition}[Abelian Categories]
An abelain category $\bcC$ is a pre-abelian category that satisfies $\forall f \in A(\bcC), \hat{f}:\Coim f \rightarrow \Imm f$ is an isomorphism.
\end{definition}
\begin{example}[Abelian Category]
The category $\Ab$ is an abelian category. In $\Ab$ one sees that the above definition that distinguish abelain categories from pre-abelian category is nothing but, what is usually is referred to by, the first isomorphism theorem in group theory. That, for any group homomorphism $f:G\rightarrow H$, $\coim f=\coker(\ker f)=G/\ker f$.
\end{example}
\begin{example}[Pre-Abelian, but not Abelian Category]

\end{example}
\begin{example}[Additive, but not Pre-Abelian Category]

\end{example}
\begin{example}[Not an additive Category]
The category $\Sets$ is not an additive category although it is limit and colimit complete. That, it does not contain a null object. Hence, $\ker$ and $\coker$ is not defined.
\end{example}
\section{Diagram Lemmas}
\begin{lemma}[$3\times 3$ Diagram]  \label{3x3Diagram}
Let $\bcA$ be an abelian category. If the the following is commutative in $\bcA$, with exact columns and second and third rows. Then, the first row is exact.
$$
\xymatrix{
A\ar@{..>}@/^/[rrd]|h\ar@{-->}@/_/[rdd]|{h_1}\ar@{-->}[rd]|{h_2}&0\ar[d] &0\ar[d] &0\ar[d]\\
&A_{11}\ar@{}[dr]|{(D_{11})}\ar[r]|{k_1}\ar@{_(->}[d]|{c_1}&A_{12}\ar@{}[dr]|{(D_{12})}\ar[r]|{f_1}  \ar@{_(->}[d]|{c_2} &A_{13} \ar@{_(->}[d]|{c_3}\\
0\ar[r]&A_{21}\ar@{}[dr]|{(D_{21})}\ar@{^(->}[r]|{k_2}\ar[d]|{g_1}&A_{22}\ar@{}[dr]|{(D_{22})}\ar[r]|{f_2} \ar[d]|{g_2} &A_{23} \ar[d]|{g_3}\\
0\ar[r]&A_{31}\ar@{^(->}[r]|{k_3}&A_{32}\ar[r]|{f_3}&A_{33}
}
$$
\end{lemma}
\begin{proof}
First notice that $c_3\circ (f_1\circ k_1)=f_2\circ k_2\circ c_1=0$. $c_3$ is a monomorphism, then $f_1\circ k_1=0$.\\
(The existence of factorisation) Let $h:A\rightarrow A_{12}$ in $\bcA$ such that $f_1\circ h=0$. Then, using the commutativity of $D_{12}$:
$$f_2\circ (c_2 \circ h)=0 $$
Then, exactness of the second row implies that $\exists! h_1:A\rightarrow A_{21}$ such that 
\begin{equation}\label{Eq_h_1}
c_2 \circ h=k_2\circ h_1
\end{equation}
Using \eqref{Eq_h_1} and the commutativity of $D_{21}$, and the exactness of the second column:
$$ k_3\circ (g_1\circ h_1)=(g_2\circ c_2)\circ h=0$$
$k_3$ is a monomorphism. Hence, $g_1\circ h_1=0$. Then, the exactness of the first column implies that $\exists! h_2:A\rightarrow A_{11}$ such that 
\begin{equation}\label{Eq_h_2}
h_1=c_1\circ h_2
\end{equation}
Using \eqref{Eq_h_2}, \eqref{Eq_h_1}, and the commutativity of $D_{11}$, we find that $c_2\circ h=c_2\circ(k_1\circ h_2)$ . $c_2$ is a monomorphism. Hence, $h=k_1\circ h_2$.\\
(The uniqueness of factorisation) Let: $h_0:A\rightarrow A_{11}$ such that $h=k_1\circ h_0$. Then using \eqref{Eq_h_1} and the commutativity of $D_{11}$, we find that $k_2\circ h_1=k_2 \circ (c_1\circ h_0)$. $k_2$ is a monomorphism, then $h_1=c_1\circ h_0$, then \eqref{Eq_h_2} implies that $h_0=h_2$. I.e. $h$ factorise uniquely through $k_1$.\\
Therefore, the first row is exact.
\end{proof}
\tcb{We did not use the commutativity of $D_22$ and exactness of third row and column. Double check if $D_{22}$ can be deleted.}
\begin{lemma}[$2\times 3$ Diagram]\label{2x3Diagram}

\end{lemma}
\begin{lemma}\label{3times3_2}
Let $\bcA$ be an abelian category, $\{A_i\stackrel{f_i}{\rightarrow} B_i\stackrel{g_i}{\rightarrow} C_i|i\in I\}$ are families of morphisms in $\bcA$, such that the the following is commutative in $\bcA$, with exact first row $\forall i \in I$. Then, the second row is exact in $\bcA$
$$
\xymatrix{
& &&\\
0\ar[r]&A_i\ar@{^(->}[rr]|{f_i}&&B_i\ar[rr]|{g_i} &&C_i\\
&\displaystyle\prod_{k\in I}A_k\ar[u]|{\pi_i}\ar[rr]|{\displaystyle\prod_{k\in I}f_k}&&\displaystyle\prod_{k\in I}B_k\ar[u]|{\pi_i}\ar[rr]|{\displaystyle\prod_{k\in I}g_k} &&\displaystyle\prod_{k\in I}C_k\ar[u]|{\pi_i}\\
A\ar@{..>}@/_/[rrru]|h\ar@{-->}@/^/[ruu]|{h_i}\ar@{-->}[ru]|{h'}
}
$$
\end{lemma}
\begin{proof}
On the one hand, $\forall i \in I$, $\pi_i\circ ({\displaystyle\prod_{k\in I}g_k}\circ {\displaystyle\prod_{k\in I}f_k})=(g_i\circ f_i)\circ \pi_i=0$. Then, by the universal property of $\displaystyle\prod_{k\in I}C_k$, we find that ${\displaystyle\prod_{k\in I}g_k}\circ {\displaystyle\prod_{k\in I}f_k}=0$\\
On the other hand, let $h:A\rightarrow \displaystyle\prod_{k\in I}B_k$ in $\bcA$ such that $(\displaystyle\prod_{k\in I}g_k)\circ h=0$. Then,$\forall i \in I$, $g_i\circ (\pi_i\circ h)=0$. Hence, $\exists! h_i:A\rightarrow A_i$ such that:
\begin{equation}\label{Eq1}
f_i\circ h_i=\pi_i\circ h, \forall i\in I
\end{equation}
Then, by the universal property of $\displaystyle\prod_{k\in I}A_k$, $\exists! h':A\rightarrow \displaystyle\prod_{k\in I}A_k$ such that:
\begin{equation}\label{Eq2}
\pi_i\circ h'=h_i, \forall i\in I
\end{equation}
Then, from \eqref{Eq1} and \eqref{Eq2}, $\forall i\in I$:
$\pi_i\circ h=f_i\circ h_i=(f_i\circ \pi_i)\circ h'=\pi_i\circ (\displaystyle\prod_{k\in I} f_k \circ h')$. Then, by the universal property of $\displaystyle\prod_{k\in I}B_k$: $h=\displaystyle\prod_{k\in I} f_k \circ h'$.\\
Let, $h'':A\rightarrow \displaystyle\prod_{k\in I}A_k$ such that $h=\displaystyle\prod_{k\in I} f_k \circ h''$. Then,
$f_i\circ (\pi_i\circ h'')=\pi_i\circ h$, i.e. $\pi_i\circ h''=h_i=\pi_i\circ h',\forall i\in I$. Then, by the universal property of $\displaystyle\prod_{k\in I}A_k$, we find that $h''=h'$. Therefore, the sequence $\xymatrix{0\ar[r]&\displaystyle\prod_{k\in I}A_k\ar@{^(->}[rr]|{\displaystyle\prod_{k\in I}f_k}&&\displaystyle\prod_{k\in I}B_k\ar[rr]|{\displaystyle\prod_{k\in I}g_k} &&\displaystyle\prod_{k\in I}C_k}$ is exact in $\bcA$.
\end{proof}

\section{Exactness Lemmas}
\begin{lemma}\label{LeftExact}
Let $\bcA$ be an additive category, then $\forall X\in \bcA$,  $Hom(X,-)$ is left exact.
\end{lemma}
\begin{proof}
\tcg{Type it down}
\end{proof}
\begin{lemma}\label{LeftExactInverse}
Let $\bcA$ be an additive category, $K, A, B \in \bcA$, then the following two statements are equivalent:
\begin{itemize}
\item The sequence $0\rightarrow K\stackrel{k}{\hookrightarrow} A \stackrel{f}{\rightarrow} B$ is exact in $\bcA$.
\item The following sequence is exact in $\Ab$, $\forall X \in \bcA$:
$${\small \xymatrix{0\ar[r]&Hom(X,K)\ar@{^(->}[rr]^{k_{\ast}} &&Hom(X,A)\ar[rr]^{f_{\ast}}&&Hom(X,B)}}
$$
I.e. $\forall X \in \bcC,$ the Yoneda  embedding $Hom(X,-)$ is left exact and \tcr{left inverse-exact}.
\end{itemize}
\end{lemma}
\begin{proof}:%
\begin{itemize}
\item Let the sequence $0\rightarrow K\stackrel{k}{\hookrightarrow} A \stackrel{f}{\rightarrow} B$ be exact in $\bcA$. Then, $\forall X \in \bcA$:\\
$\forall g\in \Ker f_{\ast}, 0=f_{\ast}(g)=f\circ g$. Hence, $\exists! g':X\rightarrow K$ such that $g=k\circ g'=k_{\ast}(g')\in \Im k_{\ast}$. I.e.$\Ker f_{\ast}\subseteq \Im k_{\ast}$.\\
$\forall g\in \Im k_{\ast}, \exists g':X\rightarrow K: g=k_{\ast}(g')=k\circ g'$. Hence, $f_{\ast}(g)=f\circ g= (f\circ k)\circ g'=0$. I.e.$\Im k_{\ast} \subseteq \Ker f_{\ast}$. Therefore, $\Im k_{\ast} = \Ker f_{\ast}$.\\
$\forall h \in \Ker k_{\ast}$: $0=k_{\ast}(h)=k\circ h$. $k$ is a monomorphism. Hence, $h=0$, $\Ker k_{\ast}=0=\Im 0$.\\
Therefore the following sequence be exact in $\Ab$, $\forall X \in \bcA$:
$${\small \xymatrix{0\ar[r]&Hom(X,K)\ar@{^(->}[rr]^{k_{\ast}} &&Hom(X,A)\ar[rr]^{f_{\ast}}&&Hom(X,B)}}
$$
\item Let following sequence be exact in $\Ab$, $\forall X \in \bcA$:
$${\small \xymatrix{0\ar[r]&Hom(X,K)\ar@{^(->}[rr]^{k_{\ast}} &&Hom(X,A)\ar[rr]^{f_{\ast}}&&Hom(X,B)}}
$$
Then, for $X=K$, we find that $0=0(id_K)=(f_{\ast}\circ k_{\ast})(id_K)=f\circ k\circ id_K=f\circ k$. I.e. $f\circ k=0$.\\
Let $g:Z\rightarrow A$ such that $f\circ g=0$. Then, for $X=Z$, $f_{\ast}(g)=f\circ g=0$. Hence, $g\in \Ker(f_{\ast})=\Im(k_{\ast})$. Since $k_{\ast}$ is a monomorphism then $\exists! h:Z\rightarrow K$ such that $g=k_{\ast}(h)=k\circ h$. Therefore, the following sequence, $0\rightarrow K\stackrel{k}{\hookrightarrow} A \stackrel{f}{\rightarrow} B$, is exact in $\bcA$.
\end{itemize}
\end{proof}

\begin{lemma}\label{LefttExactInverse2}
Let $\bcA$ be an additive category, $A, B, C \in \bcA$, then the following two statements are equivalent:
\begin{itemize}
\item The sequence $A \stackrel{f}{\rightarrow} B \stackrel{c}{\twoheadrightarrow} C \rightarrow 0  $ is exact in $\bcA$.
\item The following sequence is exact in $\Ab$, $\forall X \in \bcA$:
$${\small \xymatrix{0\ar[r]&Hom(C,X)\ar@{^(->}[rr]^{c^{\ast}} &&Hom(B,X)\ar[rr]^{f^{\ast}}&&Hom(A,X)}}
$$
I.e. $\forall X \in \bcC,$ the Yoneda  embedding $Hom(-,X)$ is left exact and \tcr{left inverse-exact}.
\end{itemize}
\end{lemma}
\begin{proof}
%Having the sequence $A \stackrel{f}{\rightarrow} B \stackrel{c}{\twoheadrightarrow} C \rightarrow 0 $ exact in $\bcA$ is equivalence to having the sequence $\xymatrix{A \stackrel{f^{op}}{\leftarrow} B&C\leftarrow 0 \ar@{_(->}[l]_{c^{op}} }$ exact in $\bcA^{op}$. By lemma \ref{LeftExactInverse}, that is equivalent to having the sequence$${\small \xymatrix{Hom_{\bcA^{op}}(X,A)  && Hom_{\bcA^{op}}(X,B) \ar[ll]_{(f^{op})_{\ast}}&&  Hom_{\bcA^{op}}(X,C)\ar@{_(->}[ll]_{(c^{op})_{\ast}}& 0\ar[l]}}$$exact in $\Ab\tcg{^op}$, $\forall X \in \bcA^{op}$. Which is equivalent to having $${\small \xymatrix{Hom(A,X)\ar[rr]^{f^{\ast}}&&Hom(B,X)\ar@{->>}[rr]^{c^{\ast}} &&Hom(X,C)\ar[r]&0 }}$$exact in $\Ab$, $\forall X \in \bcA$.
\begin{itemize}
\item Let the sequence $A \stackrel{f}{\rightarrow} B \stackrel{c}{\twoheadrightarrow} C \rightarrow 0  $ be exact in $\bcA$. Then, $\forall X \in \bcA$:\\
$\forall g\in \Ker f^{\ast}, 0=f^{\ast}(g)=g\circ f$. Hence, $\exists! g':C\rightarrow X$ such that $g=g'\circ c=c^{\ast}(g')\in \Im c^{\ast}$. I.e.$\Ker f^{\ast}\subseteq \Im c^{\ast}$.\\
$\forall g\in \Im c^{\ast}, \exists g':C\rightarrow X: g=c^{\ast}(g')=g'\circ c$. Hence, $f^{\ast}(g)=f\circ f=g'\circ(c\circ f)=0$. I.e.$\Im c^{\ast} \subseteq \Ker f^{\ast}$. Therefore, $\Im c^{\ast} = \Ker f^{\ast}$.\\
$\forall h \in \Ker k_{\ast}$: $0=k_{\ast}(h)=k\circ h$. $k$ is a monomorphism. Hence, $h=0$, $\Ker k_{\ast}=0=\Im 0$.\\
$\forall h\in \Ker c^{\ast}$: $0=c^{\ast}(h)=h\circ c$. $c$ is an epimorphism. Hence, $h=0$, and $\Ker c^{\ast}=0=\Im 0$.
Therefore the following sequence be exact in $\Ab$, $\forall X \in \bcA$:
$${\small \xymatrix{0\ar[r]&Hom(C,X)\ar@{^(->}[rr]^{c^{\ast}} &&Hom(B,X)\ar[rr]^{f^{\ast}}&&Hom(A,X)}}
$$
\item Let following sequence be exact in $\Ab$, $\forall X \in \bcA$:
$${\small \xymatrix{0\ar[r]&Hom(C,X)\ar@{^(->}[rr]^{c^{\ast}} &&Hom(B,X)\ar[rr]^{f^{\ast}}&&Hom(A,X)}}
$$
Then, for $X=C$, we find that $0=0(id_C)=(f^{\ast}\circ c^{\ast})(id_C)= id_c \circ  c\circ f=c\circ f$. I.e. $c\circ f=0$.\\
Let $g:B\rightarrow Z$ such that $g\circ f=0$. Then, for $X=Z$, $f^{\ast}(g)=g\circ f=0$. Hence, $g\in \Ker(f^{\ast})=\Im(c^{\ast})$. Since $c^{\ast}$ is a monomorphism then $\exists! h:C\rightarrow Z$ such that $g=c^{\ast}(h)=h\circ c$. Therefore, the following sequence, $A \stackrel{f}{\rightarrow} B \stackrel{c}{\twoheadrightarrow} C \rightarrow 0  $, is exact in $\bcA$.
\end{itemize}
\end{proof}


k is epi, monoic then $k_{\ast}$, $k^{\ast}$ are..


prove in general for any full subcategory, where the inclusion functor admits an adjoint, $S\cong F(S)$ for all $S$ of the subcategory, where $F$ is athe adjoint.

Notation for left and right adjoints.
\\
Cartesian Product
$$
\xymatrix{
A\ar[r]\ar[d]&B\ar[d]\ar@{}@<+16pt>[dl]|{\lrcorner}\\
C\ar[r]&D\ar@{}[lu]|{\circlearrowright}
}
$$
\black 
\begin{lemma}
Let $\bcC$ a category with fibre products, then $(U\times_X V)\times_U(U\times_X W)\cong ((U\times_X V)\times_X W)\cong (U\times_X (V\times_X W))$.
\end{lemma}
\begin{proof}
\tcr{red}
\end{proof}